home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MSG Graphic Effects 1.0 Source / Ripple wipe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-21  |  1.5 KB  |  47 lines  |  [TEXT/KAHL]

  1. /*******************************************************************************
  2.  * Copywrite © 1992-1993 David S. Blumenthal                                   *
  3.  *                                                                             *
  4.  * This file is provided as is, and may be freely distributed unaltered.  This *
  5.  * message must accompany any copy of this file.  This file may be used or     *
  6.  * modified for use for a non-commercial product provided that appropriate     *
  7.  * credit is given to the author named above.                                  *
  8.  * Commercial use of this source code is prohibited.                           *
  9.  ******************************************************************************/
  10.  
  11. #include "msg misc.h"
  12. #include "msg timing.h"
  13.  
  14. #define        BigRippleSize    52
  15. #define        gap                8
  16. #define CorrectTime 1
  17.  
  18. void RippleWipe(GrafPtr);
  19.  
  20. void RippleWipe(GrafPtr myGrafPtr)
  21. {
  22.     int        bigy, littley, barpos;
  23.     Rect    src, dest;
  24.     
  25.     src.left = 0;
  26.     src.right = MAIN_WINDOW_WIDTH;
  27.     
  28.     for(bigy = 0; bigy < MAIN_WINDOW_HEIGHT; bigy += BigRippleSize)
  29.     {
  30.         for(littley = bigy; littley < bigy + BigRippleSize; littley += gap)
  31.         {
  32.             for(barpos = bigy; barpos + gap < bigy + BigRippleSize; barpos += gap);
  33.             for(; barpos >= littley; barpos -= gap)
  34.             {
  35.                 StartTiming();
  36.                 src.top = littley;
  37.                 src.bottom = littley + gap;
  38.                 dest = src;
  39.                 dest.top = barpos;
  40.                 dest.bottom = barpos + gap;
  41.                 CopyBits(&(myGrafPtr->portBits), &(gMainWindow->portBits),
  42.                         &src, &dest, 0, 0L);
  43.                 TimeCorrection(CorrectTime);
  44.             }
  45.         }
  46.     }
  47. }